'use strict'

const config = require('../../config/config.js')

module.exports = [
  {
    pre: true,
    middleware: async (c, next) => {
      if (c.query.key !== config.sys.key) {
        return c.status(401).send('unauthorized')
      }

      await next()
    }
  }
]
